<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:widget="http://www.netvibes.com/ns/">
	<head>
		<title>Weather.com Map</title>
		<link rel="icon" href="" type="image/x-icon" />

    		<meta name="author" content="Matt Johnson" />
    		<meta name="description" content="A Weather.com Weather Map UWA Widget." />
    		<meta name="apiVersion" content="1.0" />
    		<meta name="inline" content="false" />
		<meta name="debugMode" content="false" />

    		<link rel="stylesheet" type="text/css" href="http://www.netvibes.com/themes/uwa/style.css" />
		<script type="text/javascript" src="http://www.netvibes.com/js/UWA/load.js.php?env=Standalone"></script>

    		<widget:preferences>
			<preference name="height" type="text" label="Widget Height" defaultValue="300" />
			<preference name="zoom" type="range" label="Zoom Level" defaultValue="7" step="1" min="1" max="19" />
			<preference name="transparency" type="range" label="Transparency" defaultValue="50" step="1" min="0" max="100" />
			<preference name="lat" type="text" label="Latitude" defaultValue="44.981314" />
			<preference name="long" type="text" label="Longitude" defaultValue="-93.245087" />
			<preference name="overlay" type="list" label="Default Map Type" defaultValue="radar">
				<option value="radar" label="Radar" />
				<option value="sat" label="Satellite" />
				<option value="satrad" label="Radar/Satellite" />
			</preference>
			<preference name="animate" type="boolean" label="Animate" defaultValue="true" />
		</widget:preferences>

    		<style type="text/css">
     		/* your CSS rules */
    		</style>

		<script type="text/javascript">
			var WeatherMap = {}

			WeatherMap.load = function() {
				var myHeight = widget.getValue('height');
				var myZoom = parseInt(widget.getValue('zoom'));
				var myTransparency = parseInt(widget.getValue('transparency'));
				var myLatitude = parseFloat(widget.getValue('lat'));
				var myLongitude = parseFloat(widget.getValue('long'));
				var myOverlay = widget.getValue('overlay');
				var myAnimate = widget.getValue('animate');

				widget.body.style.padding = "0";

				var myURL = "http://image.weather.com/web/flash/FMMain.swf";
				myURL += "?viewPortWidth=" + widget.body.clientWidth;
				myURL += "&viewPortHeight=" + myHeight;
				myURL += "&initialZoomLevel=" +myZoom;
				myURL += "&panFrameAlpha=" + myTransparency;
				myURL += "&lat=" + myLatitude;
				myURL += "&long=" + myLongitude;
				myURL += "&initialWeatherLayerType=" + myOverlay;
				myURL += "&wxAnimateOnStart=" + myAnimate;

				myHTML = "<iframe src=\"" + myURL + "\" frameborder=\"0\" height=\"" + myHeight + "\" style=\"width:100%;\"></iframe>";

				
				widget.setBody(myHTML); 
			}

			widget.onLoad = function() {
				WeatherMap.load();
			}

			widget.onRefresh = function() {
				WeatherMap.load();
			}

			widget.onResize = function() {
				WeatherMap.load();
			}
		</script>
	</head>

	<body>
		Loading...
	</body>
</html>
